import { close, connect, ObjectId } from "../../util/mongo"
export default defineEventHandler(async (event) => {
   const {db,client} = await connect()
        const collection = db.collection('purchase')
        
      const id = getRouterParam(event,"id")
      const _id = new ObjectId(id)
       
        const result = await collection.deleteOne({_id})
        close(client)
})
